Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrBCTC_kqsxkd
    Private thang, nam, sqlQuery, reportPath, thoigian As String
    Private customerReport As ReportDocument
    Private flagIn As Integer = 0


    Private Sub FrmCrBCTC_kqsxkd_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        frmLoading.Show()
        If flagIn = 0 Then
            sqlQuery = "SELECT * from bctc_kqkd48 where recycleID='" & nam & "'  ORDER BY sapxep"
            reportPath = Application.StartupPath & "\" & "crBCTC_kqsxkd48.rpt"
        End If
        If flagIn = 1 Then
            sqlQuery = "SELECT * from bctc_cdkt48 where recycleID='" & nam & "'  ORDER BY sapxep"
            reportPath = Application.StartupPath & "\" & "crBCTC_cdkt48.rpt"
        End If
        If flagIn = 2 Then
            sqlQuery = "SELECT * from bctc_lctttt48 where recycleID='" & nam & "'  ORDER BY sapxep"
            reportPath = Application.StartupPath & "\" & "crBCTC_lctttt48.rpt"
        End If
      
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        customerReport.SetParameterValue("TNam", nam)
        customerReport.SetParameterValue("Tthoigian", thoigian)
        customerReport.SetParameterValue("company", globalVariale.COMPANY)
        customerReport.SetParameterValue("address", globalVariale.ADDRESS)
        customerReport.SetParameterValue("mst", globalVariale.MASOTHUE)
        Me.CrNXTTongHopview.ReportSource = customerReport
        frmLoading.Close()
        frmLoading.Dispose()
    End Sub
    Public Sub setTieude_thoigian(ByVal s As String)
        thoigian = s
    End Sub
    Public Sub setThang(ByVal s As String)
        thang = s
    End Sub
    Public Sub setNam(ByVal s As String)
        nam = s
    End Sub
    Public Sub setInchung(ByVal s As Integer)
        flagIn = s
    End Sub

End Class
